Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomType's are Simple not necessarily Classic, and report their TypeTag #328

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Aug 1, 2023

  • Hopefully this will fix problems you were seeing @ss2165

@acl-cqc acl-cqc requested a review from ss2165 August 1, 2023 16:41
@acl-cqc acl-cqc changed the title CustomType's are Simple not necessarily Classic CustomType's are Simple not necessarily Classic, and report their TypeTag Aug 1, 2023
impl From<CustomType> for ClassicType {
fn from(ty: CustomType) -> Self {
ty.classic_type()
/// This parallels [SimpleType::new_tuple] and [SimpleType::new_sum]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any point in having an equivalent to ClassicType::new_tuple. We can statically rule out ClassicType::new_tuple(...Qubit...) whereas here we cannot, so at best we can only impl TryFrom<CustomType> for ClassicType and you might as well turn the ÇustomType into a SimpleType and try_from that.

Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

…eTag

CustomType's convert into *correct* SimpleType via Into (like new_tuple)
Drop .classic_type(), add .tag()
@acl-cqc acl-cqc enabled auto-merge August 2, 2023 09:38
@acl-cqc acl-cqc added this pull request to the merge queue Aug 2, 2023
Merged via the queue into main with commit 13c0094 Aug 2, 2023
5 checks passed
@acl-cqc acl-cqc deleted the bugfix/custom_simple branch August 2, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants